package com.b2b.util;

import com.b2b.model.EvaluateDto;
import com.b2b.model.entity.goods.Evaluate;
import com.b2b.service.EvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class EvaluateUtil {

    private final EvaluateService evaluateService;

    @Autowired
    public EvaluateUtil(EvaluateService evaluateService){
        this.evaluateService = evaluateService;
    }

    public EvaluateDto getEvaluateDto(Evaluate evaluate){
        EvaluateDto evaluateDto = new EvaluateDto();

        evaluateDto.setShopId(evaluate.getShopId());
        evaluateDto.setEvaluateId(evaluate.getEvaluateId());
        evaluateDto.setOrderId(evaluate.getOrderId());
        evaluateDto.setGoodsId(evaluate.getGoodsId());
        evaluateDto.setLevel(evaluate.getLevel());
        evaluateDto.setContext(evaluate.getContext());

        return evaluateDto;
    }
}
